A real-time cryptocurrency trading dashboard powered by AI agents with multi-exchange support
Project description
HashTrade
A real-time cryptocurrency trading dashboard powered by Strands Agents with AI-driven trading assistance, multi-exchange support via CCXT, and dynamic UI customization.
๐ Try the Live Dashboard | ๐ฆ Install from PyPI
โจ Features
- ๐ค AI Trading Assistant - Natural language interface for trading operations
- ๐ Real-time Market Data - Live OHLCV charts with WebSocket streaming
- ๐ฑ Multi-Exchange Support - Bybit, Binance, OKX, KuCoin, Kraken, Coinbase, and 100+ more via CCXT
- ๐จ Dynamic Theming - 7 built-in themes + custom color picker
- ๐ Action History - Persistent timeline of trades, signals, and events
- ๐ง Dynamic UI Rendering - Agent can render cards, tables, charts, alerts on-the-fly
- โก WebSocket Streaming - Real-time agent responses with tool execution visibility
๐๏ธ Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ HashTrade Dashboard โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Frontend (docs/index.html) โ
โ โโโ Market Graph (OHLCV Chart) โ
โ โโโ History of Actions (Timeline) โ
โ โโโ Agent Screen (Chat with streaming) โ
โ โโโ Theme Customization โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ WebSocket Server (server/main.py) โ
โ โโโ Strands Agent with callback streaming โ
โ โโโ Direct CCXT for UI actions (fast path) โ
โ โโโ History sync & persistence โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Tools โ
โ โโโ use_ccxt - Universal exchange interface โ
โ โโโ history - Action logging & persistence โ
โ โโโ interface - Dynamic UI & theme control โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ Quick Start
Installation
# Install from PyPI
pip install hashtrade
# Or clone the repository
git clone https://github.com/mertozbas/hashtrade.git
cd hashtrade
# Create virtual environment
python3 -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install in development mode
pip install -e .
Configuration
Set your model provider (choose one):
# AWS Bedrock (recommended)
export MODEL_PROVIDER=bedrock
# Requires AWS credentials configured
# Anthropic
export MODEL_PROVIDER=anthropic
export ANTHROPIC_API_KEY=your_key
# OpenAI
export MODEL_PROVIDER=openai
export OPENAI_API_KEY=your_key
# Ollama (local, free)
export MODEL_PROVIDER=ollama
export STRANDS_MODEL_ID=qwen3:1.7b
Set exchange credentials (optional, for trading):
# Generic CCXT credentials
export CCXT_EXCHANGE=bybit
export CCXT_API_KEY=your_api_key
export CCXT_SECRET=your_api_secret
# Or exchange-specific
export BYBIT_API_KEY=your_api_key
export BYBIT_API_SECRET=your_api_secret
Running
# Start the server
python server/main.py
# Or use the CLI command
hashtrade
Then open the HashTrade in your browser and click Connect.
๐ฌ Usage Examples
Natural Language Trading
"buy 0.001 BTC" โ Creates market buy order
"sell 100 USDT of ETH" โ Market sell
"limit buy BTC at 50000" โ Limit order
"check balance" โ Shows account balances
"price of ETH" โ Gets current ticker
"show me ETH/USDT chart" โ Fetches OHLCV data
Theme Customization
"change to cyberpunk theme" โ Magenta/cyan theme
"make it blue" โ Ocean blue theme
"I want gold colors" โ Gold luxury theme
"change accent color to purple" โ Custom accent color
Dynamic UI
The agent can render interactive components:
"show me a table of top 10 coins"
"display a progress bar for my portfolio"
"create an alert for when BTC hits 70000"
๐ ๏ธ Tools Reference
use_ccxt
Universal CCXT client for cryptocurrency exchange operations.
Actions:
| Action | Description | Required Params |
|---|---|---|
list_exchanges |
List all 100+ supported exchanges | - |
describe |
Get exchange capabilities | exchange |
fetch_ticker |
Get ticker for symbol | symbol |
fetch_ohlcv |
Get OHLCV candles | symbol, timeframe, limit |
fetch_balance |
Get account balance | - |
create_order |
Create new order | symbol, side, order_type, amount |
cancel_order |
Cancel existing order | order_id |
multi_orderbook |
Compare orderbooks across exchanges | exchanges, symbol |
Example:
use_ccxt(
action="create_order",
exchange="bybit",
symbol="BTC/USDT",
side="buy",
order_type="limit",
amount=0.001,
price=50000
)
history
Persist and fetch dashboard action history.
Actions:
| Action | Description | Params |
|---|---|---|
add |
Add history entry | event_type, data |
tail |
Get recent entries | limit |
clear |
Clear all history | - |
Event Types: order, trade, signal, note, theme
interface
Dynamic UI rendering and theme control.
Theme Actions:
| Action | Description | Params |
|---|---|---|
set_theme |
Apply preset theme | preset |
update_color |
Change single color | color_name, color_value |
list_presets |
List available themes | - |
reset_theme |
Reset to default | - |
Preset Themes:
neon_green(default)cyberpunk(magenta/cyan)ocean_blue(blue/teal)sunset_orange(orange/amber)gold_luxury(gold/black)matrix_green(pure green)dark_minimal(white/gray)
UI Render Actions:
| Action | Description | Params |
|---|---|---|
render_card |
Styled card component | title, content |
render_table |
Data table | title, data |
render_chart |
Bar chart widget | title, data |
render_alert |
Toast notification | content, style |
render_progress |
Progress indicator | title, data |
render_html |
Raw HTML injection | html |
clear_ui |
Clear dynamic components | target |
๐ Project Structure
hashtrade/
โโโ server/
โ โโโ main.py # WebSocket server & agent
โ โโโ data/
โ โ โโโ history.jsonl # Persisted history (auto-created)
โ โโโ tools/
โ โโโ use_ccxt.py # CCXT exchange tool
โ โโโ history.py # Action history tool
โ โโโ interface.py # UI/theme tool
โโโ docs/
โ โโโ index.html # Dashboard frontend (GitHub Pages)
โโโ pyproject.toml # Package configuration
โโโ README.md
โ๏ธ Configuration Options
Environment Variables
| Variable | Description | Default |
|---|---|---|
DASH_HOST |
Server bind host | 127.0.0.1 |
DASH_PORT |
Server port | 8090 |
DASH_EXCHANGE |
Default exchange | bybit |
DASH_DATA_DIR |
Data directory | ./data |
DASH_CUSTOM_PROMPT |
Custom system prompt | - |
DASH_CUSTOM_PROMPT_FILE |
Path to custom prompt file | - |
MODEL_PROVIDER |
LLM provider | auto-detect |
STRANDS_MODEL_ID |
Model identifier | provider-specific |
CCXT_EXCHANGE |
Default exchange for CCXT | - |
CCXT_API_KEY |
API key | - |
CCXT_SECRET |
API secret | - |
CCXT_SANDBOX |
Enable sandbox mode | false |
CCXT_DEFAULT_TYPE |
Market type (spot/swap) | - |
Frontend Settings
The dashboard stores settings in localStorage:
- Exchange selection
- API credentials (stored locally only)
- Symbol and timeframe
- Live update interval
- Theme preferences
๐ Security Notes
- API credentials are stored in browser localStorage only
- Server logs redact sensitive information
- Use sandbox/testnet mode for development:
CCXT_SANDBOX=true - Never commit API keys to version control
๐งช Development
Running Tests
pip install -e ".[dev]"
pytest
Adding New Tools
- Create tool file in
server/tools/ - Use
@tooldecorator from strands - Import and add to agent in
server/main.py
from strands import tool
@tool
def my_tool(action: str, param: str = None) -> dict:
"""Tool description for the agent."""
# Implementation
return {"status": "success", "content": [{"text": "result"}]}
Custom System Prompt
Create a file with your custom instructions:
export DASH_CUSTOM_PROMPT_FILE=/path/to/my_prompt.txt
Or set directly:
export DASH_CUSTOM_PROMPT="Always confirm orders. Focus on risk management."
๐ License
Apache License 2.0
๐ Acknowledgments
- Strands Agents - AI agent framework
- CCXT - Cryptocurrency exchange library
- websockets - WebSocket implementation
#trade
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hashtrade-1.1.0.tar.gz.
File metadata
- Download URL: hashtrade-1.1.0.tar.gz
- Upload date:
- Size: 58.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6f2a471c277ae7272aa1503b1f0379c043b01c99db3925de2a45759947a5d51
|
|
| MD5 |
d6bc00baaaddb1369338215f018cf9d4
|
|
| BLAKE2b-256 |
bda7ad31f2a0d6e67b668fd786501a1a5c180aa6fff8c557dda99fff6eee32c1
|
File details
Details for the file hashtrade-1.1.0-py3-none-any.whl.
File metadata
- Download URL: hashtrade-1.1.0-py3-none-any.whl
- Upload date:
- Size: 36.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
36d607123d333e96ecb0d1b9c4ed95fb5b74bc6b40382c305184829b3542dffd
|
|
| MD5 |
3d83d9b34ce9364d84f5d4e37cf505c2
|
|
| BLAKE2b-256 |
af6bdf7ddd316b2cc059bdabcfee327d9f27a4b5d881b5f0528842b7101d4abc
|